package com.shoufeng.service;

import com.shoufeng.grpc.MessageRequest;
import com.shoufeng.grpc.MessageResponse;
import com.shoufeng.grpc.MessageServiceGrpc.MessageServiceImplBase;
import io.grpc.stub.StreamObserver;

public class MessageServiceImpl extends MessageServiceImplBase {

  @Override
  public void addMessage(MessageRequest request, StreamObserver<MessageResponse> responseObserver) {
    System.out.println("服务器接收到的参数request: " + request.getMessageId());
    responseObserver.onNext(MessageResponse.newBuilder().setMessageId("22").setMessageType("tt22").build());
    responseObserver.onCompleted();
  }
}
